<?php

namespace App\Http\Controllers\Api;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Models\Config;

class ConfigController extends Controller
{
    public function index()
    {
        return Config::all();
    }

    public function update(Request $request, $id)
    {
        $config = Config::find($id);

        return response()->json($config->update($request->all()));
    }

    public function show($id)
    {
        return Config::find($id);
    }

    public function store(Request $request)
    {
        $data = $request->all();
        return  Config::create($data);
    }
}
